﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Sundry.App_Start.Common
{
    public class SetHelper
    {
        private static readonly string _uploadSetPath = "/App_Data/UploadSet.xml";

        /// <summary>
        /// 获取上传配置
        /// </summary>
        /// <returns></returns>
        public static Sundry.Model.UploadSet GetUploadSet()
        {
            return Sundry.Common.XmlHelper.DeserializeFromXML(typeof(Sundry.Model.UploadSet), Sundry.App_Start.Common.PubliFunction.GetMapPath(_uploadSetPath)) as Sundry.Model.UploadSet; 
        }
        /// <summary>
        /// 保存上传配置
        /// </summary>
        /// <param name="uploadSet">Sundry.Model.UploadSet 类</param>
        /// <returns></returns>
        public static bool SaveUploadSet(Sundry.Model.UploadSet uploadSet)
        {
            return Sundry.Common.XmlHelper.SerializeToXml(uploadSet, Sundry.App_Start.Common.PubliFunction.GetMapPath(_uploadSetPath));
        }
    }
}